package cn.ahaoweb.drule.core.model.info;

import cn.ahaoweb.drule.core.model.enums.RuleClassType;
import lombok.Getter;
import lombok.Setter;

import java.util.Map;

/**
 * @Name: 对象信息
 * @Description:
 * @Author: wangzhonghao
 * @Date: 2025/1/26 16:30
 */
@Getter
@Setter
public class ClassInfo extends BaseInfo{

    /**
     * 规则对象类型
     */
    private RuleClassType classType;

    // 父类遍历深度
    private Integer superDepth;

    // 子对象遍历深度
    private Integer childDepth;


    public static final class ClassInfoBuilder {
        private ClassInfo classInfo;

        private ClassInfoBuilder() {
            classInfo = new ClassInfo();
        }

        public static ClassInfoBuilder builder() {
            return new ClassInfoBuilder();
        }

        public ClassInfoBuilder name(String name) {
            classInfo.setName(name);
            return this;
        }

        public ClassInfoBuilder code(String code) {
            classInfo.setCode(code);
            return this;
        }

        public ClassInfoBuilder path(String path) {
            classInfo.setPath(path);
            return this;
        }

        public ClassInfoBuilder fqcn(String fqcn) {
            classInfo.setFqcn(fqcn);
            return this;
        }

        public ClassInfoBuilder properties(Map<String, String> properties) {
            classInfo.setProperties(properties);
            return this;
        }

        public ClassInfoBuilder classType(RuleClassType classType) {
            classInfo.setClassType(classType);
            return this;
        }

        public ClassInfo build() {
            return classInfo;
        }
    }
}
